package cn.ffcs.contract.model;

import java.util.Date;
import cn.ffcs.base.model.BaseEntity;
import cn.ffcs.system.dict.model.Dict;

/**
 * 合同实体类：定义基本属性<br/> <table>
 * <tr>
 * <td>负责人/principal:</td>
 * <td colspan="2">g.pany</td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:2009-6-20</td>
 * <td>修改人:g.pany</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * 
 * @author g.pany
 * @version $Id$
 */

public class ContractInfo extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** 合同名称* */
	private String contractName;

	/** 产品类型* */
	private Dict contractType;

	/** 签约方公司名称* */
	private String signatoriesName;

	/** 下一操作人* */
	private String nextUser;

	/** 创建时间* */
	private Date createTime;

	/** 版本* */
	private String version;

	/** 目前会签部门* */
	private String currDept;

	/** 会签意见* */
	private String advice;

	/** 提交时间* */
	private Date submitTime;

	/** 到达时间* */
	private Date arrivalTime;

	/** 处理时间* */
	private Date processTime;

	/** 生效时间* */
	private Date effectTime;

	/** 到期时间* */
	private Date maturityTime;

	/** 归档时间* */
	private Date filingTime;

	/** 正式合同编号* */
	private String serial;

	/** 会签编号* */
	private String signCode;

	/** 合同金额* */
	private String amount;

	/** 合同状态* */
	private String status;

	/** 是否顺延* */
	private String postpone;

	/** 顺延时间* */
	private Date postponeTime;

	/** 第三方名称* */
	private String thirdName;
	
	/** 合作内容* */
	private String hezuoContent;
	
	/** 合作内容简要说明* */
	private String hezuoContentInfo;
	
	/** 合作模式* */
	private String hezuoMode;
	
	/** 合作模式具体说明* */
	private String hezuoModeInfo;
	
	/** 对方联系人* */
	private String contact;
	
	/** 对方联系电话* */
	private String contactTel;
	
	/** 备注* */
	private String notes;
	
	/** 特殊约束条款 * */
	private String condInfo;
	
	/** 创建者姓名 * */
	private String creatorName;
	
	/** 效力* */
	@SuppressWarnings("unused")
	private String potency;

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getPostpone() {
		return postpone;
	}

	public void setPostpone(String postpone) {
		this.postpone = postpone;
	}

	public Date getPostponeTime() {
		return postponeTime;
	}

	public void setPostponeTime(Date postponeTime) {
		this.postponeTime = postponeTime;
	}

	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	public String getSignCode() {
		return signCode;
	}

	public void setSignCode(String signCode) {
		this.signCode = signCode;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	/** default constructor */
	public ContractInfo() {
	}

	/** minimal constructor */
	public ContractInfo(int id) {
		this.id = id;
	}

	public String getContractName() {
		return contractName;
	}

	public void setContractName(String contractName) {
		this.contractName = contractName;
	}

	public Dict getContractType() {
		return contractType;
	}

	public void setContractType(Dict contractType) {
		this.contractType = contractType;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getNextUser() {
		return nextUser;
	}

	public void setNextUser(String nextUser) {
		this.nextUser = nextUser;
	}

	public String getSignatoriesName() {
		return signatoriesName;
	}

	public void setSignatoriesName(String signatoriesName) {
		this.signatoriesName = signatoriesName;
	}

	public String getAdvice() {
		return advice;
	}

	public void setAdvice(String advice) {
		this.advice = advice;
	}

	public Date getArrivalTime() {
		return arrivalTime;
	}

	public void setArrivalTime(Date arrivalTime) {
		this.arrivalTime = arrivalTime;
	}

	public String getCurrDept() {
		return currDept;
	}

	public void setCurrDept(String currDept) {
		this.currDept = currDept;
	}

	public Date getProcessTime() {
		return processTime;
	}

	public void setProcessTime(Date processTime) {
		this.processTime = processTime;
	}

	public Date getSubmitTime() {
		return submitTime;
	}

	public void setSubmitTime(Date submitTime) {
		this.submitTime = submitTime;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public Date getFilingTime() {
		return filingTime;
	}

	public void setFilingTime(Date filingTime) {
		this.filingTime = filingTime;
	}

	public Date getEffectTime() {
		return effectTime;
	}

	public void setEffectTime(Date effectTime) {
		this.effectTime = effectTime;
	}

	public Date getMaturityTime() {
		return maturityTime;
	}

	public void setMaturityTime(Date maturityTime) {
		this.maturityTime = maturityTime;
	}

	@SuppressWarnings("deprecation")
	public String getPotency() {
		Date d=new Date();
		d.setMonth(d.getMonth()+3);//加三个月时间
		if (maturityTime == null && postponeTime == null) {
			return "永久有效";
		}
		if (postponeTime == null) {
			if (maturityTime != null && maturityTime.before(new Date())) {
				return "失效";
			} else if (maturityTime != null && maturityTime.before(d)) {
				return "即将失效";
			}
			return "有效";
		} else {
			if (postponeTime.before(new Date())) {
				return "失效";
			} else if (postponeTime.before(d)) {
				return "即将失效";
			}
			return "有效";
		}

	}

	public void setPotency(String potency) {
		this.potency = potency;
	}

	public static void main(String[] args) {
		System.out.println(new Date(new Date().getTime() + (long) 90
				* (1000 * 60 * 60 * 24)));

		System.out.println(new Date().getTime());
		System.out.println((long) 90 * (1000 * 60 * 60 * 24));
		System.out.println(new Date().getTime() + (long) 90
				* (1000 * 60 * 60 * 24));
	}

	public String getThirdName() {
		return thirdName;
	}

	public void setThirdName(String thirdName) {
		this.thirdName = thirdName;
	}

	public String getHezuoContent() {
		return hezuoContent;
	}

	public void setHezuoContent(String hezuoContent) {
		this.hezuoContent = hezuoContent;
	}

	public String getHezuoContentInfo() {
		return hezuoContentInfo;
	}

	public void setHezuoContentInfo(String hezuoContentInfo) {
		this.hezuoContentInfo = hezuoContentInfo;
	}

	public String getHezuoMode() {
		return hezuoMode;
	}

	public void setHezuoMode(String hezuoMode) {
		this.hezuoMode = hezuoMode;
	}

	public String getHezuoModeInfo() {
		return hezuoModeInfo;
	}

	public void setHezuoModeInfo(String hezuoModeInfo) {
		this.hezuoModeInfo = hezuoModeInfo;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getContactTel() {
		return contactTel;
	}

	public void setContactTel(String contactTel) {
		this.contactTel = contactTel;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public String getCondInfo() {
		return condInfo;
	}

	public void setCondInfo(String condInfo) {
		this.condInfo = condInfo;
	}

	public String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

}
